var minionOperationGroup = function(klass, minionId){
    return [
        '<div class="btn-group operation-group">',
            '<button class="btn btn-sm ',
            klass || '',
            ' btn-tooltip btn-del-inline" data-toggle="tooltip" type="button" title="移除">',
                    '<i class="fa fa-trash-o"></i>',
            '</button>',
            '<button data-toggle="dropdown" class="btn btn-sm ',
                klass || '',
                ' dropdown-toggle" type="button">',
                    '<i class="fa fa-angle-down"></i>',
            '</button>',
            '<ul role="menu" class="dropdown-menu pull-right">',
                '<li><a href="javascript:;" class="btn-exec-inline">执行命令</a></li>',
                '<li class="divider"></li>',
                '<li><a href="javascript:;" class="btn-detail-inline">硬件信息</a></li>',
                '<li><a href="#/process/' + minionId + '" class="btn-process-inline">进程信息</a></li>',
                '<li><a href="#/project/' + minionId + '" class="btn-project-inline">工程信息</a></li>',
            '</ul>',
        '</div>'
    ].join(''); 
};

var textTooltip = function(title, text){
    return [
        '<span class="btn-tooltip" data-toggle="tooltip" title="' +title+ '">',
        text || '',
        '</span>'
    ].join('');
}

/*
 * 分组折叠
 */
var collapsedPopover = function(popText, first, klass, noarrow){
    return [
        '<a role="button" class="btn-popover ',
        klass || '',
        '" tabindex="0" data-toggle="popover" ',
        'data-placement="auto" data-title="" data-trigger="manual" data-html="true" ',
        'data-content="' + popText + '">',
            first,
            noarrow ? '' : '<i class="fa fa-angle-double-down" aria-hidden="true"></i>',
        '</a>'
    ].join('');
};

/*
 * 宽度限制
 */
var widthRestrictedPopover = function(popText, first, klass){
    return collapsedPopover(popText, first, klass, true);
};
